package com.lesama.stream.input;

// 输入流一次读取一个字节数组

import java.io.FileInputStream;
import java.io.IOException;

public class FileInputStreamDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:\\b.txt");
        byte[] bys = new byte[2];
        int len = 0;
        while((len = fis.read(bys)) != -1) {
            System.out.println(new String(bys, 0, len));
        }
        fis.close();
    }
}
